import type { RouteRecordRaw } from 'vue-router';
import RouterView from '@/layout/routerView/index.vue';
import menu from '@/assets/menuIcon/menu3.png';

const moduleName = 'detection';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/detection',
    name: moduleName,
    component: RouterView,
    redirect: '/detection/sample',
    meta: {
      title: '检测管理',
      icon: menu,
    },
    children: [
      {
        path: 'sample',
        name: `${moduleName}-sample`,
        component: () => import('@/views/project/sample/index.vue'),
        meta: {
          title: '样品管理',
        },
      },
      {
        path: 'task',
        name: `${moduleName}-task`,
        component: () => import('@/views/project/task/index.vue'),
        meta: {
          title: '检测任务',
        },
      },
      {
        path: 'report',
        name: `${moduleName}-report`,
        component: () => import('@/views/project/report/index.vue'),
        meta: {
          title: '报告管理',
        },
      },
    ],
  },
];

export default routes;
